[mlir][dxsa] Add topology instructions#198
Conversation
Example: dxsa.cut dxsa.emit dxsa.emit_then_cut dxsa.emit_stream 1 dxsa.cut_stream 3 dxsa.emit_then_cut_stream 2
73b0263 to
2c32aeb
Compare
| // dxsa.emit_then_cut | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| def DXSA_EmitThenCut : DXSA_NullaryOp<"emit_then_cut"> { |
There was a problem hiding this comment.
Microsoft call this emitThenCut rather than emit_then_cut, likewise for emitThenCut_stream, is it possible to use their name or does it need to be this?
There was a problem hiding this comment.
Instruction names in Microsoft's specification are formed according to different naming rules, rather than following a single uniform convention. We decided to use snake_case for operation names to maintain consistency across the dialect.
| @@ -0,0 +1,154 @@ | |||
| //===- DXSTopologyOps.td - DXSA topology ops ---------------*- tablegen -*-===// | |||
There was a problem hiding this comment.
| //===- DXSTopologyOps.td - DXSA topology ops ---------------*- tablegen -*-===// | |
| //===- DXSATopologyOps.td - DXSA topology ops ---------------*- tablegen -*-===// |
| // CHECK-NEXT: dxsa.emit_stream 0 | ||
| 0x03000075, 0x00110000, 0x00000000 | ||
|
|
||
| // CHECK-NEXT: dxsa.emit_stream 1 |
There was a problem hiding this comment.
Redundant: all three stream ops decode the index through the same path. Maybe we can keep happy path for boundaries only (0 and 3)?
There was a problem hiding this comment.
Sure, fixed that.
| // CHECK-NEXT: dxsa.emit_stream 1 | ||
| 0x03000075, 0x00110000, 0x00000001 | ||
|
|
||
| // CHECK-NEXT: dxsa.emit_stream 2 |
| // CHECK-NEXT: dxsa.cut_stream 0 | ||
| 0x03000076, 0x00110000, 0x00000000 | ||
|
|
||
| // CHECK-NEXT: dxsa.cut_stream 1 |
| // CHECK-NEXT: dxsa.cut_stream 1 | ||
| 0x03000076, 0x00110000, 0x00000001 | ||
|
|
||
| // CHECK-NEXT: dxsa.cut_stream 2 |
| // CHECK-NEXT: dxsa.emit_then_cut_stream 0 | ||
| 0x03000077, 0x00110000, 0x00000000 | ||
|
|
||
| // CHECK-NEXT: dxsa.emit_then_cut_stream 1 |
| // CHECK-NEXT: dxsa.emit_then_cut_stream 1 | ||
| 0x03000077, 0x00110000, 0x00000001 | ||
|
|
||
| // CHECK-NEXT: dxsa.emit_then_cut_stream 2 |
| // DXSA shared bases for ops with inline operands | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| class DXSA_NullaryOp<string mnemonic> : DXSA_Op<mnemonic> { |
There was a problem hiding this comment.
This is identical to what is in #194; I'm not sure which PR had it first and where the review comment should go. Regardless, the same comment applies here.
Example:
dxsa.cut
dxsa.emit
dxsa.emit_then_cut
dxsa.emit_stream 1
dxsa.cut_stream 3
dxsa.emit_then_cut_stream 2